package kr.co.mustgo.domain.review;

import java.io.Serializable;

public class Comment implements Serializable{
	private int cmNo;			//댓글 번호
	private String writer;		//작성자
	private String content;		//내용
	private String writedate;	//작성 일시
	private int no;				//원본 글번호
	
	//생성자
	public Comment(){}
	public Comment(String writer, String content, int no) {
		this.writer = writer;
		this.content = content;
		this.no = no;
	}
	public Comment(int cmNo, String writer, String content, String writedate,
			int no) {
		this.cmNo = cmNo;
		this.writer = writer;
		this.content = content;
		this.writedate = writedate;
		this.no = no;
	}
	
	//getter/setter
	public int getCmNo() {
		return cmNo;
	}
	public void setCmNo(int cmNo) {
		this.cmNo = cmNo;
	}
	public String getWriter() {
		return writer;
	}
	public void setWriter(String writer) {
		this.writer = writer;
	}
	public String getContent() {
		return content;
	}
	public void setContent(String content) {
		this.content = content;
	}
	public String getWritedate() {
		return writedate;
	}
	public void setWritedate(String writedate) {
		this.writedate = writedate;
	}
	public int getNo() {
		return no;
	}
	public void setNo(int no) {
		this.no = no;
	}
	
	//toString()
	@Override
	public String toString() {
		return "Comment [cmNo=" + cmNo + ", writer=" + writer + ", content="
				+ content + ", writedate=" + writedate + ", no=" + no + "]";
	}
	
	//hashCode()/equals()
	@Override
	public int hashCode() {
		final int prime = 31;
		int result = 1;
		result = prime * result + cmNo;
		result = prime * result + ((content == null) ? 0 : content.hashCode());
		result = prime * result + no;
		result = prime * result
				+ ((writedate == null) ? 0 : writedate.hashCode());
		result = prime * result + ((writer == null) ? 0 : writer.hashCode());
		return result;
	}
	@Override
	public boolean equals(Object obj) {
		if (this == obj)
			return true;
		if (obj == null)
			return false;
		if (getClass() != obj.getClass())
			return false;
		Comment other = (Comment) obj;
		if (cmNo != other.cmNo)
			return false;
		if (content == null) {
			if (other.content != null)
				return false;
		} else if (!content.equals(other.content))
			return false;
		if (no != other.no)
			return false;
		if (writedate == null) {
			if (other.writedate != null)
				return false;
		} else if (!writedate.equals(other.writedate))
			return false;
		if (writer == null) {
			if (other.writer != null)
				return false;
		} else if (!writer.equals(other.writer))
			return false;
		return true;
	}
	
	
}






